<?php


function currentURL()
{
  //the domain:
  $domain = $_SERVER['HTTP_HOST'];
  // path to the current file:
  $path = $_SERVER['SCRIPT_NAME'];
  // the QueryString:
  $queryString = $_SERVER['QUERY_STRING'];
  // put it all together:
  $url = "http://" . $domain . $path . "?" . $queryString;
  return $url;
}




?>